<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let passFinal = true
        if (passFinal) {
            console.log('通过')
        } else {
            console.log('没通过')
        }
        //三元运算符
        let result = passFinal ? '通过' : '没通过'
        console.log(result)
        //switch语句
        let num = 2
        switch (num) {
            case 1:
                console.log('星期一')
                break
            case 2:
                console.log('星期二')
                break
            case 3:
                console.log('星期三')
                break
            case 4:
                console.log('星期四')
        }

        let year = +prompt("请输入年份判断是不是闰年")
        let re = ""
        if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
            re = year + "是闰年"
            console.log(re)
        } else {
            re = year + "不是闰年"
            console.log(re)
        }
        document.write(re)
    </script>
</body>
</html>